package cn.jjxx.modules.portal.utils;

import java.util.concurrent.atomic.AtomicInteger;

/**
 *
 */
public class SMSCodeEhcache {

    /**接收手机号码*/
    private String phone;
    /**消息内容*/
    private String messageContent;
    /**缓存次数*/
    private Integer count;
    /**最大缓存次数，超过该次数不再进行缓存。如果该值为null则表示不限制，无需计数*/
    private Integer maxCount;
    /**验证码*/
    private String smsCode;
    /**计数缓存名*/
    private String countCacheName;
    /**计数缓存key*/
    private String countCacheKey;
    /**验证码缓存名*/
    private String codeCacheName;
    /**验证码缓存key*/
    private String codeCacheKey;
    /**是否缓存成功*/
    private Boolean success = Boolean.FALSE;
    /**消息*/
    private String message;
    /** IP */
    private String ip;
    /** 根据该IP总的获取短信次数计数 */
    private Integer countByIp;

    public SMSCodeEhcache() {
    }

    public SMSCodeEhcache(String phone, String messageContent, Integer maxCount, String countCacheName, String countCacheKey,
                          String codeCacheName, String codeCacheKey) {
        this.phone = phone;
        this.messageContent = messageContent;
        this.maxCount = maxCount;
        this.countCacheName = countCacheName;
        this.countCacheKey = countCacheKey;
        this.codeCacheName = codeCacheName;
        this.codeCacheKey = codeCacheKey;
    }

    public SMSCodeEhcache(String phone, String messageContent, Integer count, Integer maxCount, String smsCode,
                          String countCacheName, String countCacheKey, String codeCacheName, String codeCacheKey) {
        this.phone = phone;
        this.messageContent = messageContent;
        this.count = count;
        this.maxCount = maxCount;
        this.smsCode = smsCode;
        this.countCacheName = countCacheName;
        this.countCacheKey = countCacheKey;
        this.codeCacheName = codeCacheName;
        this.codeCacheKey = codeCacheKey;
    }

    public void success(String message) {
        this.success = Boolean.TRUE;
        this.message = message;
    }

    public void fail(String message) {
        this.success = Boolean.FALSE;
        this.message = message;
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public String getMessageContent() {
        return messageContent;
    }

    public void setMessageContent(String messageContent) {
        this.messageContent = messageContent;
    }

    public Integer getCount() {
        return count;
    }

    public void setCount(Integer count) {
        this.count = count;
    }

    public Integer getMaxCount() {
        return maxCount;
    }

    public void setMaxCount(Integer maxCount) {
        this.maxCount = maxCount;
    }

    public String getSmsCode() {
        return smsCode;
    }

    public void setSmsCode(String smsCode) {
        this.smsCode = smsCode;
    }

    public String getCountCacheName() {
        return countCacheName;
    }

    public void setCountCacheName(String countCacheName) {
        this.countCacheName = countCacheName;
    }

    public String getCountCacheKey() {
        return countCacheKey;
    }

    public void setCountCacheKey(String countCacheKey) {
        this.countCacheKey = countCacheKey;
    }

    public String getCodeCacheName() {
        return codeCacheName;
    }

    public void setCodeCacheName(String codeCacheName) {
        this.codeCacheName = codeCacheName;
    }

    public String getCodeCacheKey() {
        return codeCacheKey;
    }

    public void setCodeCacheKey(String codeCacheKey) {
        this.codeCacheKey = codeCacheKey;
    }

    public Boolean getSuccess() {
        return success;
    }

    public void setSuccess(Boolean success) {
        this.success = success;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public String getIp() {
        return ip;
    }

    public void setIp(String ip) {
        this.ip = ip;
    }

    public Integer getCountByIp() {
        return countByIp;
    }

    public void setCountByIp(Integer countByIp) {
        this.countByIp = countByIp;
    }
}
